/*
 * @Author: zhangwenqiang
 * @Date: 2021-07-26 16:06:24
 * @LastEditors: OBKoro1
 * @LastEditTime: 2021-07-27 10:47:10
 * @FilePath: /operate/src/store/index.js
 */
import getters from './getters'
// import Vue from 'vue'
// import Vuex from 'vuex'
Vue.use(Vuex)


const path = require('path')
const modulesFiles = require.context('./modules', true, /\.js$/)

const modules = modulesFiles.keys().reduce((modules, modulePath) => {
  const moduleName = path.basename(modulePath, '.js')
  const value = modulesFiles(modulePath)
  modules[moduleName] = value.default
  return modules
}, {})

const store = new Vuex.Store({
  modules,
  getters
})

export default store
